<script setup lang="ts">
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
import { key } from '../store/index';
const router = useRouter();
const store = useStore(key);

const logout = () =>{
  store.dispatch('logout');
  router.push('/login');
}

</script>

<template>
  <h1>tearch</h1>
  <button @click="logout">退出登录</button>
</template>

<style scoped lang="scss">

</style>